<!DOCTYPE html>
<%@page isELIgnored="false"%>
<html lang="en">
<head>
  <meta charset="utf-8" >
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">
  <link rel="shortcut icon" th:href="@{#}" type="image/png">

  <title>用户添加</title>

    <link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap-fileupload.min.css}" />
    <div th:include="common :: commonheader"/>
</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <div th:replace="common :: #leftmenu " ></div>
    <!-- left side end-->
    
    <!-- main content start-->
    <div class="main-content" >

        <!-- header section start-->
        <div th:replace="common :: headermenu" ></div>
        <!-- header section end-->

        <!-- page heading start-->
        <div class="page-heading">
            <h3>
                用户添加
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a th:href="@{/main.html}">首页</a>
                </li>
                <li>
                    <a th:href="@{/user/list}">用户管理</a>
                </li>
                <li class="active">用户添加</li>
            </ul>
        </div>
        <!-- page heading end-->

        <!--body wrapper start-->
        <div class="wrapper">
            <div class="row">
                <div class="col-lg-12">
                    <section class="panel">
                        <header class="panel-heading">
                            用户添加
                        </header>
                        <div class="panel-body">
                            <div class="form">
                                <form class="cmxform form-horizontal adminex-form" id="signupForm" method="post" th:action="@{/user/save}" >
                                    <div class="form-group ">
                                        <label for="user_name" class="control-label col-lg-2">用户名称</label>
                                        <div class="col-lg-10">
                                            <input class=" form-control" id="user_name" name="userName" type="text" />
                                        </div>
                                    </div>
                                    <div class="form-group ">
                                        <label for="password" class="control-label col-lg-2">用户密码</label>
                                        <div class="col-lg-10">
                                            <input class=" form-control" id="password" name="password" type="text" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label col-lg-2" for="inlineCheckbox1">选择角色</label>
                                        <div class="col-lg-10">
                                            <label class="checkbox-inline" th:each="role:${roles}">
                                                <input type="checkbox" id="inlineCheckbox1" th:value="${role.id}" name="roleIds"> [[${role.roleName}]]
                                            </label>

                                        </div>
                                    </div>
                                    <div class="form-group ">
                                        <label for="open"  class="control-label col-lg-2">状态</label>
                                        <div class="col-lg-10">
                                            <div class="radio">
                                                <label>
                                                    <input  type="radio" name="enable" id="open" value="1" checked/>
                                                    开启
                                                </label>
                                            </div>
                                            <div class="radio">
                                                <label>
                                                    <input  type="radio" name="enable" id="close" value="0"/>
                                                    禁用
                                                </label>
                                            </div>

                                        </div>
                                    </div>
                                    <div class="form-group ">
                                        <label for="desc" class="control-label col-lg-2">用户详情</label>
                                        <div class="col-lg-10">
                                            <div class="panel-body">

                                                    <div class="form-group">

                                                            <textarea rows="6" class="form-control" id="desc" name="userDesc"></textarea>

                                                    </div>

                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-lg-offset-2 col-lg-10">
                                            <button class="btn btn-primary" type="submit" >Save</button>
                                            <button class="btn btn-default" type="button" onclick="jump()">Cancel</button>
                                        </div>
                                    </div>

                                </form>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </div>
        <!--body wrapper end-->

        <!--footer section start-->
        <footer>
            2020 &copy; AdminEx by ThemeBucket </a>
        </footer>
        <!--footer section end-->


    </div>
    <!-- main content end-->
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<div th:include="common :: #commonscript" />

<!--<script type="text/javascript" th:src="@{/js/jquery.validate.min.js}"></script>-->
<!--<script th:src="@{/js/validation-init.js}"></script>-->

<script th:src="@{/js/spinner-init.js}"></script>
<script type="text/javascript" th:src="@{/js/bootstrap-fileupload.min.js}"></script>

<script th:inline="javascript">
    function jump(){
        window.location.href="/user/list";
    }

    function checkForm(){
        var form = document.getElementById('signupForm');
        return true;
    }


</script>
</body>
</html>
